<template>
	<view>
		<Comment
			v-for="(comment,index) in comments" 
			:key="index"
			:author="author"
			:comment="comment"
		/>
	</view>
</template>

<script>
	import Comment from "@/components/Comment/Comment.vue"
	export default {
		components:{
			Comment,
		},
		data() {
			return {
				comments:null,
			};
		},
		onLoad: function (option) {
			uni.request({
				url: "https://apis.netstart.cn/douguo/recipe/flatcomments/"+option.id+'/0/20',
				success: (res) => {
						this.author = option.author;
						this.comments = res.data.result.comments;
						this.all = res.data.result.cc;
				    }
			});
		},
	}
</script>

<style lang="less">

</style>
